library(curl)

control = list(
  smtpServer="smtp://smtp.qq.com",
  smtpPort = 587,
  verbose = TRUE
)

curlopts = list(
  username = sender,
  password = token,
  login_options = "AUTH=LOGIN"
)
library(sendmailR)
sendmail(from = sender, 
         to = recipients, 
         subject="SMTP auth test", 
         msg=mime_part("This message was send using sendmailR and curl."), 
         engine = "curl", 
         engineopts = curlopts, 
         control = control
)
